<?php

namespace App\Http\Requests\System;

use App\Http\Requests\Request;

class DemanderRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return TRUE;
    }

    protected $messages=[
        'username.required'=>'用户名必须',
        'username.exists'=>'用户名错误或不存在',
        'password.required'=>'密码必须',
        'password.exists'=>'密码错误'
    ];

    public function rules()
    {
        return [
        'username' => 'exists:use,Name,Del,1|required',
        'password' => 'exists:use,Pwd,Name,'.$name.'|required'
        ];
    }

    public function messages()
    {
        return $this->messages;
    }


}
